<style lang="scss" scoped>
    @import '../../css/resource.scss';
</style>

<template>

    <section>

        <section class="book-nav clearfix">
            <el-breadcrumb separator=" > " class="fl">
                <el-breadcrumb-item >资源管理</el-breadcrumb-item>
                <el-breadcrumb-item :to="{ path: '/resource/my-resource'}">我的资源</el-breadcrumb-item>
                <el-breadcrumb-item ><span @click="gotoBackPage">{{tabName}}</span></el-breadcrumb-item>
                <el-breadcrumb-item >详情</el-breadcrumb-item>
            </el-breadcrumb>
        </section>

        <section class="course-ctaudio mt">
            <h3 class="ctvideo-title fs-16">{{title}}</h3>
            <div class="audio-box">
                <audio class="audio" :src="resUrl" height="400" width="100%" controls>
                    <!--<source src="horse.ogg" >-->
                    <!--<source src="horse.mp3" >-->
                    您的浏览器不支持 audio 元素。
                </audio>
            </div>
        </section>

        <div class="mt ctvideo-info">
            <h6 class="fs-14 vinfo-title">简介</h6>
            <div class="vinfo-des break-word">
                <p class="mt fs-14" v-html="abstract"></p>
            </div>
        </div>

    </section>

</template>

<script>

	import qs from 'qs'

	export default{
		data: function(){
			return {
                tabName:this.$route.query.TabName||'',
			    resUrl:this.$route.query.resUrl,
			    title:this.$route.query.title,
                abstract:'',
                uploadFlag:this.$route.query.uploadFlag||0
            }
		},
		mixins: [mixinMethods],
		methods: {
            gotoBackPage(){
                history.go(-1)
            },
		},
		mounted: function(){
		    if(this.uploadFlag==1){
                axios.post('/api/system/getFullUrl', qs.stringify({
                    fileObject:JSON.stringify([{url:this.resUrl,param:''}])
                })).then((res) => {
                    var d = res.data;
                    if(d.flag == 1){
                        this.resUrl = d.data.url;
                    }else {
                        this.$message.error(d.msg)
                    }
                });
            }
            this.abstract = sessionStorage.getItem('courseInfoAbstract')
		}
	}


</script>